
<?php
$this->breadcrumbs=array(
	'Ticket Management'=>array('index'),
    'List Event To Create'
);
?>  
<?php if(Yii::app()->user->hasFlash('error')) : ?>
<?php echo Yii::app()->user->getFlash('error'); ?>
<?php endif; ?>
<div class="row-fluid">
    <div class="row-fluid">
        <div class="table-header">
            Event Management
        </div>             
        <table id="sample-table-2" class="table table-striped table-bordered table-hover">
            <thead>
                <tr>
                    <th>Event code</th>
                    <th>Main title</th>
                    <th>Category</th>
                    <!--<th>Gallery</th>-->
                    <th>Status</th>
                    <!--Danh cho icon-->
                    <th>Actions</th>
                    <!--Danh cho icon--> 
                </tr>
            </thead>
            <tbody>
                <?php
                if (count($data) > 0):
                    foreach ($data as $item) :
                        ?> 
                        <tr>
                            <td><?php echo $item->event_code ?> </td>
                            <td><?php echo $item->translate[1]->main_title ?> </td>
                            <td><?php echo $item->category->name ?> </td>
<!--                            <td>
                                <?php if(isset($item->gallery)) : ?>
                                    <?php echo $item->gallery->name ?>
                                <?php else : ?>
                                    Null, Please update
                                <?php endif; ?>
                            </td>-->
                            <td>
                                <?php
                                    switch ($item->status) :
                                    case STATUS_ACTIVE:
                                ?>
                                    <span class="label label-success">Openning</span>
                                <?php break;?>
                                <?php default :?>
                                    <span class="label label-default">Expried</span>
 
                                <?php break; ?>
                                <?php endswitch; ?>
                                <?php switch ($item->active_status) :
                                    case STATUS_ACTIVE:
                                ?>
                                    <a class="label label-success" onclick="in_active_status(<?php echo $item->id; ?>)">
                                            Active
                                    </a>
                                <?php break;?>
                                <?php case STATUS_INACTIVE: ?>
                                    <a class="label label-warning" onclick="active_status(<?php echo $item->id; ?>)">
                                            Inactive
                                    </a>
                                <?php break;?>
                                <?php default :?>
                                    <a class="label label-warning" onclick="active_status(<?php echo $item->id; ?>)">
                                            Inactive
                                    </a> 
                                <?php break; ?>
                                <?php endswitch; ?>
                            </td>
                            <!--Danh cho icon-->
                            <td class="td-actions">
                                <div class="hidden-phone visible-desktop action-buttons">
                                    
                                    <a class="green" href="<?php echo Yii::app()->createAbsoluteUrl('bookingsystem/ticket/create', array('event_id' => $item->id)); ?>">
                                        <i class="icon-plus bigger-130"></i>
                                    </a>
<!--                                    <a class="red" href="<?php // echo Yii::app()->createAbsoluteUrl($parentUrl . '/delete', array('id' => $item->id)); ?>">
                                        <i class="icon-trash bigger-130"></i>
                                    </a>-->
                                </div>
                                <div class="hidden-desktop visible-phone">
                                    <div class="inline position-relative">
                                        <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
                                            <i class="icon-caret-down icon-only bigger-120"></i>
                                        </button>
                                        <ul class="dropdown-menu dropdown-icon-only dropdown-yellow pull-right dropdown-caret dropdown-close">
                                            
                                            <li>
                                                <a href="<?php // echo Yii::app()->createAbsoluteUrl($parentUrl . '/update', array('id' => $item->id)); ?>" class="tooltip-success" data-rel="tooltip" title="Edit">
                                                    <span class="green">
                                                        <i class="icon-edit bigger-120"></i>
                                                    </span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="<?php // echo Yii::app()->createAbsoluteUrl($parentUrl . '/delete', array('id' => $item->id)); ?>" class="tooltip-error" data-rel="tooltip" title="Delete">
                                                    <span class="red">
                                                        <i class="icon-trash bigger-120"></i>
                                                    </span>
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </td>
                            <!--Danh cho icon-->
                        </tr>
                    <?php endforeach;
                endif; ?>                                    
            </tbody>
        </table>
    </div>
</div><!--/.row-fluid-->